<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>系统配置</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="">
    <meta name="description" content="">
    {sys:load href="admin/css/bootstrap.min.css,admin/css/materialdesignicons.min.css,admin/css/style.min.css"}
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <ul class="nav nav-tabs page-tabs">
                    <li class="active"> <a href="javascript:void(0)">基本配置</a> </li>
                    <li> <a href="javascript:void(0)">上传</a> </li>
                    <li> <a href="javascript:void(0)">微信</a> </li>
                </ul>
                <div class="tab-content active0">
                    <div class="tab-pane active">
                        {include file="config/base"}
                    </div>
                </div>
				
				<div class="tab-content active1" style="display:none">
					<div class="tab-pane active">
						{include file="config/uploader"}
					</div>
				</div>

                <div class="tab-content active2" style="display:none">
                    <div class="tab-pane active">
                        {include file="config/weixin"}
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>
{sys:load href="admin/lib/layui/layui.js,admin/common.js"}

<script type="text/javascript">
    layui.use(['Request', 'jquery'], function(){
        var req = layui.Request
        ,$ = layui.jquery, layer = layui.layer;

        $(".btn-submit").on('click', function(){
            let formDom = $(this).attr('form-id');
            req.post('/admin/config/setting', formDom, function(response){
                layer.msg('更新成功!', {time: 1000}, function(){
                    window.location.reload();
                })
            })
        });
		
		$(".page-tabs li").click(function(){
			var index = $(this).index();
			$(this).addClass('active')
			$(this).siblings('li').removeClass('active');
			$(".active" + index).show();
			$(".active" + index).siblings('div').hide();
		});
		
		$("input[name='upload_mode']").click(function(){
			var index = $(this).val();
			if (index == 'public') {
				$(".upload_config_aliyun").hide();
				$(".upload_config_qiniu").hide();
			} else {
				$(".upload_config_"+index).show();
				$(".upload_config_"+index).siblings('.upload_config').hide();
			}
		});
		
    })
</script>

</body>
</html>
